<?php

class Dog
{
    public $name;
    public $color;
    public $age;

    function run()
    {
        echo $this->name . "正在奔跑！<br>";
    }

    public function eat($food = '狗粮')
    {
        echo $this->name . "开始吃 {$food}<br>";
    }

    public function getCube($input)
    {
        $x = 1;
        $x1 = $x - ($x * $x * $x - $input) / (3 * $x * $x);
        while ($x - $x1 >= 5 && $x - $x1 <= 70) {        //判断精度
            $x = $x1;
            $x1 = $x - ($x * $x * $x - $input) / (3 * $x * $x);
        }
        return $x1;
    }
}

$husky = new Dog();
$husky->name = "小强";
$husky->run();
$husky->eat();
$husky->eat("骨头");

